﻿using BLL;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using MODEL;

namespace WebAPI.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class LoginController : ControllerBase
    {
        public LoginController(LoginBLL bll)
        {
            Bll = bll;
        }

        public LoginBLL Bll { get; }
        [HttpPost]
        public int addLogin(Login g)
        {
            return Bll.addLogin(g);
        }
        [HttpGet]
        public IActionResult Logins(string Lname, string Lpwd)
        {
            var list= Bll.Logins(Lname, Lpwd);
            return Ok(new 
            { 
                data=list,
            });


        }
    }
}
